<template>
   <rx-dialog @handOk="handleSubmit" @cancel="cancel">
     <rx-layout>
       <div slot="center">
         <a-form :form="form" >
           <a-form-item style="display:none">
             <a-input v-decorator="['catId']"/>
           </a-form-item>
           <a-form-item :label-col="{ span: 5 }" :wrapper-col="{ span: 16 }" :label="i18n('form.name','名称')">
               <rx-input-i18n :placeholder="i18n('form.name','名称')" :isDecorator="true"
                              v-decorator="['name', {rules: [{required: true, message: i18n('form.name','名称','input')}]}]"/>
           </a-form-item>
           <a-form-item :label-col="{ span: 5 }" :wrapper-col="{ span: 16 }" :label="i18n('form.key','标识Key')">
             <a-input :placeholder="i18n('form.key','标识Key')" v-decorator="['key', {rules: [{required: true, message: i18n('form.key','标识Key','input')}]}]"/>
           </a-form-item>

           <a-form-item :label-col="{ span: 5 }" :wrapper-col="{ span: 16 }" :label="i18n('form.desc','描述')">
             <a-textarea :placeholder="i18n('form.desc','描述')" v-decorator="['descp', {rules: [{required: true, message: i18n('form.desc','描述','input')}]}]" :rows="6" />
           </a-form-item>
           <a-form-item :label-col="{ span: 5 }" :wrapper-col="{ span: 16 }" :label="i18n('form.sn','序号')">
             <a-input-number :min="1" :max="10000" :placeholder="i18n('form.sn','序号')" v-decorator="['sn', {initialValue:1,rules: [{required: true, message: i18n('form.sn','序号','input')}]}]" />
           </a-form-item>
         </a-form>
       </div>
     </rx-layout>

   </rx-dialog>
</template>
<script>
  import SysTreeCatApi from '@/api/system/core/sysTreeCat'
  import {BaseForm,RxDiaog,RxLayout,RxInputI18n} from "@lowcode/jpaas-common-lib";
  export default {
    name: 'SysTreeCatEdit',
    mixins:[BaseForm],
      components: {
        RxDiaog,
        RxLayout,
        RxInputI18n
    },
    data () {
      return {
        visible: false,
        mdl: {},
      }
    },
    methods: {
       i18n(name,text,key){
         return this.$ti18(name,text,"SysTreeCat",key);
       },
       get(id) {
          return SysTreeCatApi.get(id)
        },
        save(values) {
          return SysTreeCatApi.save(values)
        }
    }
  }
</script>
<style scoped>
  .ant-row.ant-form-item:last-child{
    margin-bottom: 0;
  }
</style>

